var HTTP_PORT = 8888;
var express = require('express');
var app = express();
var allowCrossDomain = function(req, res, next) {
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
    res.header('Access-Control-Allow-Headers', 'Content-Type');
    res.header('Access-Control-Allow-Credentials','true');
    next();
};
app.use(allowCrossDomain);
var apiRoutes = require('./api/apiroutes.js')
app.use('/api', apiRoutes);
var server = app.listen(HTTP_PORT);
var uri = 'http://localhost:' + HTTP_PORT;
console.log('> Listening at ' + uri + '\n')